import React from 'react'
import Login from './pages/Login'
import Admin from './pages/Admin'
import { Switch,Route,Redirect } from 'react-router-dom'

import { Provider } from 'react-redux'
import { store } from './store'

import yztoken from './utils/token'

 function App() {
  return ( <Provider store={store}>
     <div>
      {/* 配置一级路由 */}
      <Switch>
        <Route path='/admin' component={Admin}/>
        <Route path='/login' component={Login}/>
        <Redirect from='/' to='/admin'/>
      </Switch>
    </div>
  </Provider>
   
  )
}

export default yztoken(App)
